-- GENERATED SPELL FOR [Rothin the Decaying] --


function spell0_27355(pUnit, Event) --@Aegis of Neltharion,Self--
pUnit:FullCastSpellOnTarget(51512,pUnit)
pUnit:RegisterEvent('Sorts_27355', 616, 1)
end

function spell1_27355(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27355', 3000, 1)
end

function spell2_27355(pUnit, Event) --@Shadowflame,Self--
pUnit:FullCastSpellOnTarget(51337,pUnit)
pUnit:RegisterEvent('Sorts_27355', 0, 1)
end

function Sorts_27355(pUnit, Event)
local choix_sorts_27355 = math.random(0, 2)
if choix_sorts_27355 == 0 then
pUnit:RegisterEvent('spell0_27355', 1, 1)
end
if choix_sorts_27355 == 1 then
pUnit:RegisterEvent('spell1_27355', 1, 1)
end
if choix_sorts_27355 == 2 then
pUnit:RegisterEvent('spell2_27355', 1, 1)
end
end

function mob27355_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_27355', math.random(1500, 3000), 1)
end

function mob27355_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27355_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27355_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(27355, 1, 'mob27355_Action')
RegisterUnitEvent(27355, 2, 'mob27355_Leave')
RegisterUnitEvent(27355, 3, 'mob27355_Kill')
RegisterUnitEvent(27355, 4, 'mob27355_Die')
